package org.fxd.zweixin.util;

public class AuthUtil {

	public static void delRoleCodes(String code) {

	}

	/**
	 * 删除该节点下的子节点
	 * 
	 * @param code
	 * @param codes
	 * @return
	 */
	public static String delchild(String code, String codes) {

		if (codes.indexOf(code) >= 0) {
			String[] codesarray = codes.split(",");
			for (String string : codesarray) {
				if (code.startsWith(string) && string.length() > code.length() || code.equals(string)) {
					System.err.println(0);
					codes = codes.replace(string, "");
				}
			}
			if (codes.indexOf(",") == 0) {
				codes = codes.substring(1);
			}
			if (codes.indexOf(",,") == 0) {
				codes.replace(",,", ",");
			}

		}
		return codes;
	}
}
